package com.primb.bench.project.home.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by Chen on 2017/5/9.
 * 功能描述：贷款测算信息实体类
 */

public class LoanInfoEntity implements Parcelable {
    /**
     * 贷款基本信息
     */
    String loanMoney;//贷款金额
    String loanDate;//贷款期限
    String loanDateUnit;//贷款期限单位
    String loanType;//币种类型
    String loanTypeId;//币种类型ID
    String loanRepayment;//还款方式
    String loanRepaymentId;
    String loanBusinessType;//贷款业务类型
    String loanBusinessTypeId;//贷款业务类型ID
    String loanIndustry = "";//贷款投向行业
    String loanIndustryId = "";//贷款投向行业ID
    String loanRateType = "";//利率类型
    String loanRateTypeId = "";//利率类型ID
    boolean isLoanInfoEmpty = true;

    public String getLoanRepayment() {
        return loanRepayment;
    }

    public void setLoanRepayment(String loanRepayment) {
        this.loanRepayment = loanRepayment;
    }

    public String getLoanRepaymentId() {
        return loanRepaymentId;
    }

    public void setLoanRepaymentId(String loanRepaymentId) {
        this.loanRepaymentId = loanRepaymentId;
    }

    public String getLoanTypeId() {
        return loanTypeId;
    }

    public void setLoanTypeId(String loanTypeId) {
        this.loanTypeId = loanTypeId;
    }

    public String getLoanBusinessTypeId() {
        return loanBusinessTypeId;
    }

    public void setLoanBusinessTypeId(String loanBusinessTypeId) {
        this.loanBusinessTypeId = loanBusinessTypeId;
    }

    public String getLoanIndustryId() {
        return loanIndustryId;
    }

    public void setLoanIndustryId(String loanIndustryId) {
        this.loanIndustryId = loanIndustryId;
    }

    public String getLoanRateTypeId() {
        return loanRateTypeId;
    }

    public void setLoanRateTypeId(String loanRateTypeId) {
        this.loanRateTypeId = loanRateTypeId;
    }

    public String getLoanDateUnit() {
        return loanDateUnit;
    }

    public void setLoanDateUnit(String loanDateUnit) {
        this.loanDateUnit = loanDateUnit;
    }

    public String getLoanMoney() {
        return loanMoney;
    }

    public void setLoanMoney(String loanMoney) {
        this.loanMoney = loanMoney.replace(",", "");
    }

    public String getLoanDate() {
        return loanDate;
    }

    public void setLoanDate(String loanDate) {
        this.loanDate = loanDate;
    }

    public String getLoanType() {
        return loanType;
    }

    public void setLoanType(String loanType) {
        this.loanType = loanType;
    }

    public String getLoanBusinessType() {
        return loanBusinessType;
    }

    public void setLoanBusinessType(String loanBusinessType) {
        this.loanBusinessType = loanBusinessType;
    }

    public String getLoanIndustry() {
        return loanIndustry;
    }

    public void setLoanIndustry(String loanIndustry) {
        this.loanIndustry = loanIndustry;
    }

    public String getLoanRateType() {
        return loanRateType;
    }

    public void setLoanRateType(String loanRateType) {
        this.loanRateType = loanRateType;
    }

    public boolean isLoanInfoEmpty() {
        return isLoanInfoEmpty;
    }

    public void setLoanInfoEmpty(boolean loanInfoEmpty) {
        isLoanInfoEmpty = loanInfoEmpty;
    }

    public LoanInfoEntity() {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.loanMoney);
        dest.writeString(this.loanDate);
        dest.writeString(this.loanDateUnit);
        dest.writeString(this.loanType);
        dest.writeString(this.loanTypeId);
        dest.writeString(this.loanRepayment);
        dest.writeString(this.loanRepaymentId);
        dest.writeString(this.loanBusinessType);
        dest.writeString(this.loanBusinessTypeId);
        dest.writeString(this.loanIndustry);
        dest.writeString(this.loanIndustryId);
        dest.writeString(this.loanRateType);
        dest.writeString(this.loanRateTypeId);
        dest.writeByte(this.isLoanInfoEmpty ? (byte) 1 : (byte) 0);
    }

    protected LoanInfoEntity(Parcel in) {
        this.loanMoney = in.readString();
        this.loanDate = in.readString();
        this.loanDateUnit = in.readString();
        this.loanType = in.readString();
        this.loanTypeId = in.readString();
        this.loanRepayment = in.readString();
        this.loanRepaymentId = in.readString();
        this.loanBusinessType = in.readString();
        this.loanBusinessTypeId = in.readString();
        this.loanIndustry = in.readString();
        this.loanIndustryId = in.readString();
        this.loanRateType = in.readString();
        this.loanRateTypeId = in.readString();
        this.isLoanInfoEmpty = in.readByte() != 0;
    }

    public static final Creator<LoanInfoEntity> CREATOR = new Creator<LoanInfoEntity>() {
        @Override
        public LoanInfoEntity createFromParcel(Parcel source) {
            return new LoanInfoEntity(source);
        }

        @Override
        public LoanInfoEntity[] newArray(int size) {
            return new LoanInfoEntity[size];
        }
    };
}
